;; =============================================================================
;; toplevel parse methods

(in-package :oali.core)

;; generic signature
(defgeneric parse-toplev (context token-id args))

;; type decl
(defmethod parse-toplev (context (id (eql 'type)) args)
  (parse-type-decl context (car args) (cdr args)))

;; func decl
(defmethod parse-toplev (context (type (eql 'func)) args)
  (parse-func-decl context (car args) (cdr args)))

;; role decl
(defmethod parse-toplev (context (type (eql 'roles)) args)
  (parse-roles-decl context args))

;; constraint decl
(defmethod parse-toplev (context (id (eql 'constraint)) args)
  (parse-constraint-decl context (car args) (cdr args)))


;; for testing purposes
(defmethod parse-toplev (context (id (eql 'test)) args)
  (parse-test-decl context (car args) (cdr args)))

